package com.shisfish.core.Test;

import java.util.Timer;
import java.util.TimerTask;

public class Reminder{  
    Timer timer = new Timer();  
    public Reminder(int seconds){  
        timer.schedule(new RemindTask(), seconds*1000);  
    }  
    class RemindTask extends TimerTask{  
        public void run(){  
            System.out.println("Time''s up!");  
            //timer.cancel(); //Terminate the timer thread  
        }  
    }  
    public static void main(String args[]){  
        System.out.println("About to schedule task.");  
        new Reminder(2);  
        System.out.println("Task scheduled.");  
    }  
}
